.TH std::span::data 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::span::data \- std::span::data

.SH Synopsis
   constexpr pointer data() const noexcept;  \fI(since C++20)\fP

   Returns a pointer to the beginning of the sequence.

.SH Return value

   A pointer to the beginning of the sequence.

.SH Example


// Run this code

 #include <iostream>
 #include <span>

 int main()
 {
     constexpr char str[] = "ABCDEF\\n";

     const std::span sp{str};

     for (auto n{sp.size()}; n != 2; --n)
         std::cout << sp.last(n).data();
 }

.SH Output:

 ABCDEF
 BCDEF
 CDEF
 DEF
 EF
 F

.SH See also

   constructor   constructs a span
                 \fI(public member function)\fP
